package cn.jack90john;

import cn.jack90john.action.Dribble;
import cn.jack90john.action.Pass;
import cn.jack90john.action.Running;
import cn.jack90john.decorator.Backward;
import cn.jack90john.decorator.Forward;
import cn.jack90john.decorator.Left;
import cn.jack90john.decorator.Right;

/**
 * Description:
 * Designer: jack
 * Date: 2017/8/9
 * Version: 1.0.0
 */
public class Test {
    public static void main(String[] args) {

        Player playerA = new Right(new Running());
        System.out.println("球员A：" + playerA.action());

        Player playerB = new Forward(new Pass());
        System.out.println("球员B：" + playerB.action());

        playerA = new Left(new Dribble());
        System.out.println("球员A：" + playerA.action());

        //进球了，球员B开始发疯似的到处乱跑
        playerB = new Forward(new Backward(new Left(new Running())));
        System.out.println("球员B：" + playerB.action());
    }
}
